home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr51 / fastpack.zip / FASTPACK.DOC < prev    next >
Text File  |  1993-04-04  |  8KB  |  146 lines

  1.                                *** Fastpack ***
  2.  
  3. Contents of Fastpack.zip:
  4.  
  5.         Fastpack.doc, this ASCII file of explanation.
  6.         Fastpack.asm, ASCII file of assembler source code.
  7.         Fastpack.bin, binary file to run within dBASE by LOAD . . . CALL--
  8.            Syntax: CALL Fastpack WITH <filespec> [/N] [/T]  && See below
  9.         Fastpack.com, binary file to run from DOS prompt--
  10.            Syntax: Fastpack <filespec> [/N] [/T]
  11.  
  12.         where <filespec> specifies the file to pack.
  13.  
  14.         The [/N] (No-backup) option, if included, specifies an in-place pack.
  15.            Without /N, the original file will be kept and renamed .bak.
  16.         The [/T] (Terse) option suppresses screen display of progress.
  17.            Without /T, a running report of records copied will be displayed.
  18.  
  19.                                *** What it is ***
  20.  
  21. Fastpack is a utility to pack dBASE files quickly.  It works on dBASE III+ and
  22. dBASE IV files, but has not been tested on purportedly compatible files
  23. created with other products.
  24.  
  25. Fastpack was written by R. Russell Freeland for the book "dBASE Power: Building
  26. and Using Programming Tools", by P. L. Olympia, R. Russell Freeland and Randy
  27. Wallin, published and copyright by Ashton-Tate Corporation, 1988.
  28.  
  29. The present version was modified by Jay Parsons, December, 1989 as follows:
  30.  
  31.         1) Pack-then-write algorithm implemented, which improves speed for
  32. records of small size relative to the buffer.
  33.         2) Only one screen write of progress per buffer.
  34.         3) Header of packed file updated to current date.
  35.         4) Packed file given original extension.
  36.         5) Assembly option for runnable .exe and .com files added.
  37.         6) Assembly option for 80386 and related instructions added.
  38.         7) Command/assembly option for no screen writing added.
  39.         8) Command/assembly option for no backup file added.
  40.         9) Numerous insignificant changes due to programmer style.
  41.  
  42. Republished by permission of Ashton-Tate Corporation.  Modifications placed
  43. in the public domain December, 1989.
  44.  
  45.                              *** How It Works ***
  46.  
  47. Fastpack does the same thing as the dBASE PACK command.  It removes records
  48. marked for deletion from dBASE files.  It usually works much faster.  However,
  49. it runs within, but does not use, dBASE.  Do not attempt to pack a file in
  50. USE in dBASE, because Fastpack will change the file but not dBASE's information
  51. about it, causing serious problems including apparent loss of data and index
  52. corruption.  Close the file first.
  53.  
  54. Also, Fastpack does not automatically reindex the file as the native PACK
  55. command does.  Issue the appropriate REINDEX commands after Fastpack runs.
  56.  
  57. If an error (disk full, for example) occurs, Fastpack will return an error
  58. code.  The .com version returns it as the DOS errorlevel, the .bin as the
  59. first character of the argument at the call.  When using the .bin,
  60. the argument of filespec and any switches must be placed in a variable,
  61. not given as a literal, if dBASE is to be able to access the error code.
  62. For example:
  63.  
  64.         Arg = "myfile /T"
  65.         CALL Fastpack WITH Arg
  66.         ? val(Arg)
  67.  
  68. *----------------------------------------------------------------------------
  69. For the most complete explanation, PLEASE see the source code, Fastpack.asm.
  70. *----------------------------------------------------------------------------
  71.  
  72. The source code contains several assembly options, through which the code
  73. may be configured to produce 72 slightly different programs.  If you don't
  74. have an assembler, you won't be able to select among them, but read on to
  75. learn how they work.
  76.  
  77. The major options are:
  78.  
  79.         1) To create a program that runs from the DOS prompt outside dBASE,
  80. as a .COM file, instead of one that runs as a .BIN.  Both options are found in
  81. the included files Fastpack.com and Fastpack.bin, so if you don't have an
  82. assembler, you may still choose and use either one.  In either case, the
  83. options ( /N, /T ) may be specified following the filespec of the file to pack.
  84.  
  85.         2) /N To create a program that does or does not create a backup (.bak)
  86. file of the packed file.  With the /N option off (default), the file is packed
  87. to a new file.  After successful packing, the new file is given the original
  88. name and the original file is given the .bak extension.  This slows down the
  89. operation of the program significantly for large files due to repeated calls to
  90. DOS to obtain additional disk clusters for the new (packed) file.  Worse, this
  91. will not work at all unless there is sufficient disk space for both the
  92. new file containing the undeleted records of the old and the old file.  If the
  93. /N option is on, the program works like the dBASE PACK command, packing the old
  94. file "in place".  This saves disk space and time but risks data loss.
  95.         This option is implemented as a three-way assembly option.  The program
  96. may be assembled always to create a new file, always to pack in place or to
  97. accept a runtime parameter specifying which way to pack.  Using this last
  98. option, the program creates a new file unless the "/N" switch is included.
  99. The included .com and .bin files both accept the runtime /N option.  If "/N"
  100. is not included, they will create a new file and rename the old.
  101.  
  102. Minor options are:
  103.  
  104.         3) /T Whether or not to print progress reports to the screen.  While
  105. interesting, such reports are undesirable in developed systems.  A three-way
  106. assembly option permits choice among no reports, always reports or acceptance
  107. of a runtime parameter, the /T switch.  The included .bin and .com files accept
  108. the switch.  If it is NOT included, reports are printed to the screen.  If the
  109. switch is included, the program creates no visible output, more or less as if
  110. TALK was SET to OFF.
  111.  
  112.         4) Whether the program uses processor instructions specific to the
  113. 80386 processor, gaining a small amount of speed at the expense of being in-
  114. compatible with earlier processors.  The default is no.
  115.  
  116.         5) Whether the program can be debugged by starting dBASE with the DOS
  117. command "DEBUG dBASE Fastpack <filespec>".  If included, this option includes
  118. a line to give control to DEBUG when the program starts.  The default is no.
  119.  
  120.         In addition, the size of the buffer (area of memory into which records
  121. of the file being packed will be read) may be changed.  This applies only if
  122. the selection at option (1) has been to create a .bin file that can be run
  123. within dBASE.  The .bin file created by option 1 uses only memory internal to
  124. itself, so if it can LOAD, it can be CALLed.  Increasing its buffer size (the
  125. default is 12,288 bytes) may speed operation, particularly if the file being
  126. packed has large records.  The program loads as many records at once as can
  127. fit in its buffer, so if each record required 4,000 bytes (the specified
  128. maximum for dBASE IV) an increase of the buffer to 16,000 bytes would
  129. eliminate 1/4 of the disk read accesses and provide a significant increase in
  130. speed.
  131.  
  132.         If the selection at option (1) was to create a .com file, it will grab
  133. a whole 64K segment of memory as its buffer.  This assumes there is at least
  134. one full segment available, which is reasonably safe if the program is run
  135. outside dBASE.  It cannot be guaranteed that enough memory will be available if
  136. the .com file is run within a future release of dBASE using the !/RUN command,
  137. and the program does not check on memory available, so it is recommended that
  138. the .com version be run only from DOS outside dBASE, not through RUN.
  139.  
  140.                                *** Problems ***
  141.  
  142. Please do not call Russ Freeland in the event of any problems with these
  143. programs.  Report any difficulties or bugs to Jay Parsons, AT-BBS Jparsons,
  144. CIS 70160,340, (201) 766-5845.
  145.  
  146.